﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="~/viagens.aspx.cs" Inherits="viagens" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Agência de Viagens</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="header">
        <ul id="menu">
            <li><a href="viagens.aspx">Consultar Viagens Marcadas</a></li>
            <li><a href="contacto.aspx">Contacto</a></li>
            <% if (Session["nome"]!=null) {%><li><a href="logout.aspx">Sair</a></li><% } %>
        </ul>
    </div>
    <div id="wrapper">
        <div id="content" runat="server">
        <h2>Viagens Marcadas</h2><br />
            <asp:GridView ID="GridView1" runat="server" CellPadding="10" ForeColor="#333333" 
                GridLines="None" 
                Width="100%" AutoGenerateColumns="False" DataSourceID="Reserva" 
                HorizontalAlign="Center" 
                onselectedindexchanged="GridView1_SelectedIndexChanged"
                OnRowDataBound="GridView1_RowDataBound">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField HeaderText="Agência" DataField="IDAgencia" 
                        SortExpression="IDAgencia" />
                    <asp:BoundField HeaderText="Cliente" DataField="IDCliente" 
                        SortExpression="IDCliente" />
                    <asp:BoundField HeaderText="Origem" DataField="IDPartida" 
                        SortExpression="IDPartida" />
                    <asp:BoundField HeaderText="Destino" DataField="IDChegada" 
                        SortExpression="IDChegada" />
                    <asp:BoundField HeaderText="Data da partida" DataField="dataPartida" 
                        SortExpression="dataPartida" />
                    <asp:BoundField HeaderText="Data da reserva" DataField="dataReserva" 
                        SortExpression="dataReserva" />
                    <asp:BoundField HeaderText="Nº de pessoas" DataField="nrPessoas" 
                        SortExpression="nrPessoas" />
                    <asp:HyperLinkField DataNavigateUrlFields="IDReserva" DataNavigateUrlFormatString="detalhes.aspx?IDReserva={0}"
DataTextField="IDReserva" DataTextFormatString="ver +" HeaderText="Detalhes" />
                </Columns>
              
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
            <asp:ObjectDataSource ID="Reserva" runat="server" SelectMethod="getByCliente" 
                TypeName="WCFReserva.WCFReservaClient">
                <SelectParameters>
                    <asp:SessionParameter DefaultValue="0" Name="idCliente" SessionField="id" 
                        Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
    </div>
    <div id="footer">
        <div>
            <a href="viagens.aspx">Consultar Viagens Marcadas</a> | <a href="contacto.aspx">Contacto</a>
        </div>
    </div>
    </form>
</body>
</html>
